/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.web.servlet;

import com.web.daoimpl.StudentDaoImpl;
import com.web.entity.Stu_admin;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 *
 * @author liqianru
 */
@WebServlet("/getstuBykey")
public class GetStudentBykeyword extends HttpServlet {

    StudentDaoImpl service=new StudentDaoImpl();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //
        String keyword=req.getParameter("keyword");
        HttpSession session=req.getSession();
        //
        System.out.println(keyword);
        List<Stu_admin> s_list=service.getBykeyword(keyword);
        System.out.println(s_list.size());
        //
        session.setAttribute("allStu", s_list);
        req.getRequestDispatcher("/admin_Student.jsp").forward(req, resp);
        
    }
    
}
